import redis

pool = redis.ConnectionPool(host='1.117.160.157', port=6379)   #声明连接池

r = redis.Redis(connection_pool=pool)   #取连接池里的链接

r.set('foo', 'bar')

print(r.get('foo'))
